<template>
    <van-card
        num="1"
        class="content"
        @click="detail"
    >
        <template #thumb></template>
        <template #title>
            <div plain type="danger">
                <span class="title">订单编号:{{data.str10}}</span>
                <van-tag :type="states[data.str5].type" style="float:right;margin-top:10px;">{{states[data.str5].text}}</van-tag>
            </div>
            <div plain type="danger">
                <span>申请时间:{{data.date2}}</span>
            </div>
        </template>
        <template #desc></template>
        <template #tags></template>
        <template #price>
            <span class="price">￥{{data.num1}}</span>
        </template>
        
        <template #footer>
            <van-divider />
            <van-button size="small" v-for="(item,index) in webApplyConfig.initOrdermgListBtnArr(data)" :key="index" @click.stop="clickHandler(item.clickHandler)">{{item.text}}</van-button>
        </template>

        <van-popup v-model="applyRefundShow">内容</van-popup>
    </van-card>
</template>

<script>
    import webApplyConfig from './cardBtn';
    export default {
        props: {
            value: {
                type: Object,
                default: function () {
                    return {}
                }
            },
            data:{
                type: Object,
                default: function () {
                    return {}
                }
            }
        },
        data() {
            return {
                states: {
                    '0': {
                        type: 'primary',
                        text: '未创建'
                    },
                    '1': {
                        type: 'warning',
                        text: '待支付'
                    },
                    '2': {
                        type: 'primary',
                        text: '审核中'
                    },
                    '3': {
                        type: 'danger',
                        text: '被退回'
                    },
                    '4': {
                        type: 'success',
                        text: '已转开'
                    },
                    '5': {
                        type: '',
                        text: '付款核实中'
                    },
                    '6': {
                        type: 'success',
                        text: '制单中'
                    },
                    '7': {
                        type: 'success',
                        text: '已出函'
                    },
                    '8': {
                        type: 'success',
                        text: '已邮寄'
                    },
                    '9': {
                        type: 'success',
                        text: '已收函'
                    },
                    '10': {
                        type: 'danger',
                        text: '付款失败'
                    },
                    '11': {
                        type: 'warning',
                        text: '申请延期'
                    },
                    '12': {
                        type: 'success',
                        text: '延期通过'
                    },
                    '13': {
                        type: 'danger',
                        text: '延期退回'
                    },
                    '14': {
                        type: 'warning',
                        text: '退款中'
                    },
                    '15': {
                        type: 'success',
                        text: '已退款'
                    },
                    '16': {
                        type: 'primary',
                        text: '已申请批改'
                    },
                    '17': {
                        type: 'success',
                        text: '申请批改通过'
                    },
                    '18': {
                        type: 'danger',
                        text: '申请批改退回'
                    },
                    '19': {
                        type: 'primary',
                        text: '订单已失效'
                    },
                    '21': {
                        type: 'primary',
                        text: '批改审核中'
                    },
                    '22': {
                        type: 'success',
                        text: '批改成功'
                    }
                },
                webApplyConfig:webApplyConfig,
                applyRefundShow:true,
            }
        },
        watch: {
        },
        computed: {
            
        },

        methods: {
            detail(){
                console.log(this.data)
                this.$router.push({
                    path: '/orderDetail',
                    query: {
                        rowguid: this.data.str2
                    }
                })
            },
            clickHandler:function(click){
                click.call(this,this.data);
            },

        },
        mounted: function () {
            
        }
    };
</script>
<style lang="less" scoped>
    /deep/ .van-card__thumb{
        width: 0;
        height: 0;
    }

    .content{
        font-size: 15px;
        line-height: 30px;
    }

    .title{
        font-weight: bold;
        font-size: 16px;
    }

    .price{
        font-weight: 500;
        font-size: 18px;
        color: #f18241;
    }
</style>